<template>
  <div class="legend">
    <h4>图例</h4>
    <div class="legend-item">
      <div class="legend-color" style="background-color: rgba(0, 200, 0, 0.5);"></div>
      <span>行政区划</span>
    </div>
    <div class="legend-item">
      <div class="legend-color" style="background-color: rgba(255, 255, 0, 0.8); border: 2px solid #ff0000;"></div>
      <span>选中区域</span>
    </div>
  </div>
</template>

<script>
import { defineComponent } from 'vue';

export default defineComponent({
  name: 'MapLegend'
});
</script>

<style scoped>
.legend {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  max-width: 200px;
}

.legend h4 {
  margin-top: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.legend-color {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  border: 1px solid #ccc;
}
</style>